package com.hualude.roadsign.repository;

import com.hualude.roadsign.dto.AlarmPushDto;
import com.hualude.roadsign.dto.CornerDto;
import com.hualude.roadsign.dto.DTRequestDto;
import com.hualude.roadsign.dto.MonthCountDto;
import com.hualude.roadsign.model.AlarmPushEntity;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

/**
 * Created by xu_jiaHui on 2018/4/1.
 */
public interface AlarmPushRepository extends CrudRepository<AlarmPushEntity, Long> {

    public List<AlarmPushDto> getAlarmPushHistory(Integer alarmType, String orgIds, String actors, Integer mCount, Integer mSize) throws Exception;

    public List<AlarmPushDto> getAlarmTypeCount(String limitTime, String orgIds) throws Exception;

    /**
     * @Description: 获取某一时间之后的count数量, lastTime, Type
     * @author xu_jiaHui
     * @date 2018/4/13
     */
    public CornerDto getCorner4App(Integer orgId, Integer deviceType, String thatTime) throws Exception;

    /**
     * @Description: 获取当前未读消息
     * @author xu_jiaHui
     * @date 2018/4/13
     */
    public List<AlarmPushDto> getCurrentPushList(Integer orgId, Integer deviceType, String newTime, String oldTime, Integer mCount, Integer mSize) throws Exception;


    /**
     * @Description 获取事件历史
     * @author xu_jiaHui
     * @date 2018/4/26
     */
    public List<AlarmPushDto> getAlarmHistory4DT(DTRequestDto dtRequestDto, String deviceId, Integer deviceType) throws Exception;


    public Integer getAlarmHistoryCount4DT(DTRequestDto dtRequestDto, String deviceId, Integer deviceType) throws Exception;

    public List<AlarmPushDto> getAlarmHistory4DT(DTRequestDto dtRequestDto, String deviceId, Integer deviceType, String orgIds, String time) throws Exception;


    public Integer getAlarmHistoryCount4DT(DTRequestDto dtRequestDto, String deviceId, Integer deviceType, String orgIds, String time) throws Exception;

    /**
     * @Description: 获取某一年的统计
     * @author xu_jiaHui
     * @date 2018/5/1
     */
    public List<MonthCountDto> getMonthCount(String alarmPushType, String startTime, String endTime, String orgIds, String deviceId) throws Exception;


    public AlarmPushDto getLastAlarmPushByDeviceId(String deviceId)throws Exception;

}
